{% extends "layout.html" %}
{% block title %}Batches{% endblock %}
{% block content %}
    <h1>Batches</h1>
    {% if batches %}
    <table class="data-table">
      <thead>
        <tr>
          <th>id</th>
          <th>type</th>
          <th>state</th>
        </tr>
      </thead>
      <tbody>
	{% for batch in batches %}
        <tr>
          <td class="numeric-cell"><a rel="noopener" href="{{ base_path }}/batches/{{ batch['id'] }}">{{ batch['id'] }}</a></td>
          <td>
            {% if 'attributes' in batch %}
            {% if 'deploy' in batch['attributes'] %}
            deploy
            {% elif 'test' in batch['attributes'] %}
            test
            {% else %}
            unknown
            {% endif %}
            {% endif %}
          </td>
          <td>
            {% if 'state' in batch and batch['state'] %}
            {{ batch['state'] }}
            {% endif %}
            {% if not batch['complete'] %}
            running
            {% endif %}
          </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
    {% endif %}
{% endblock %}
